package com.weiweiqin.service.impl;

import com.weiweiqin.dao.CustomerFavItemDao;
import com.weiweiqin.model.CustomerFavItem;
import com.weiweiqin.service.CustomerFavItemService;
import com.weiweiqin.vo.common.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CustomerFavItemServiceImpl implements CustomerFavItemService {
	@Autowired
	private CustomerFavItemDao customerFavItemDao;

	public List<CustomerFavItem> pageList(Page page, Map<String, Object> conditions) {
		return customerFavItemDao.pageList(page, conditions);
	}

	public int totalCount(Map<String, Object> conditions) {
		return customerFavItemDao.totalCount(conditions);
	}

	public void save(CustomerFavItem customerFavItem) {
		customerFavItemDao.insert(customerFavItem);
	}

	public CustomerFavItem get(int id) {
		return customerFavItemDao.get(id);
	}

	public void del(int id) {
		customerFavItemDao.delete(id);
	}

	public CustomerFavItem getByGoodsIdAndCustomerId(int customerId, int goodsId) {
		return customerFavItemDao.getByGoodsIdAndCustomerId(customerId,goodsId);
	}


}